package com.day12;

public class Test {
    public static void main(String[] args) {
        //声明两个int类型变量
        int i1=7;
        int i2=2;
        System.out.println("基本运算符演示，整数类型");
        System.out.println("i1=i1 "+i1+" i2=i2 "+i2);
        System.out.println("i1+i2= "+(i1+i2));
        System.out.println("i1-i2= "+(i1-i2));
        System.out.println("i1*i2= "+(i1*i2));
        System.out.println("i1/i2= "+(i1/i2));
        System.out.println("i1/i2= "+((double)i1/i2));

        //声明两个double类型变量
        double d1=8.0;
        double d2=2.5;
        System.out.println("浮点类型演示");
        System.out.println("d1=d1 "+d1+" d2=d2 "+d2);
        System.out.println("d1+d2= "+(d1+d2));
        System.out.println("d1-d2= "+(d1-d2));
        System.out.println("d1*d2= "+(d1*d2));
        System.out.println("d1*d2= "+(int)(d1*d2));
        System.out.println("d1/d2= "+(d1/d2));
    }
}
